From b97b8b6ec186b0d666bf55f53344a284f5419619 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 27 Apr 2017 07:40:14 +0200 Subject: [PATCH] button: Compute clip directly --- gtk/gtkbutton.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index df8e455c79..60660905ff 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -872,9 +872,17 @@ gtk_button_allocate (GtkCssGadget *gadget, widget = gtk_css_gadget_get_owner (gadget); + *out_clip = *allocation; + child = gtk_bin_get_child (GTK_BIN (widget)); if (child && gtk_widget_get_visible (child)) - gtk_widget_size_allocate_with_baseline (child, (GtkAllocation *)allocation, baseline); + { + GtkAllocation clip; + + gtk_widget_size_allocate_with_baseline (child, (GtkAllocation *)allocation, baseline); + gtk_widget_get_clip (child, &clip); + gdk_rectangle_union (&clip, out_clip, out_clip); + } if (gtk_widget_get_realized (widget)) { @@ -886,8 +894,6 @@ gtk_button_allocate (GtkCssGadget *gadget, border_allocation.width, border_allocation.height); } - - gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip); } static void -- 2.30.2